package com.suray.wcs.service.hk.agv.type;

public enum HkAgvProcessType {

    INIT(1, "初始化"),
    GO_TO_START(2, "Agv前往取货点"),
    REACH_OUT_START(11, "到达取货点外面"),
    SEND_AGV_INTO_START(12, "允许AGV进入起点取货"),
    INTO_START_POINT(21, "进入取货点"),
    GET_CARGO(31, "取货中"),
    WAIT_AGV_OUT_OF_START(32, "等待AGV离开取货点"),
    OUT_OF_START(41, "离开取货点"),
    GO_TO_END(42,"前往放货点"),
    REACH_OUT_END(51, "到达取货点外面"),
    SEND_AGV_INTO_END(52, "允许AGV进入终点放货"),
    INTO_END_POINT(61, "进入放货点"),
    PUT_CARGO(71, "放货中"),
    WAIT_AGV_OUT_OF_END(72, "等待AGV离开放货点"),
    OUT_OF_END(81, "离开放货点"),
    END(100, "结束"),
    ;

    int value;
    String des;

    HkAgvProcessType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public String getDes() {
        return des;
    }

    public static HkAgvProcessType parseProcess(int value) {
        for (HkAgvProcessType process : HkAgvProcessType.values()) {
            if (process.value == value) {
                return process;
            }
        }

        throw new RuntimeException("海康Agv进度错误：" + value);
    }

    @Override
    public String toString() {
        return des;
    }
}
